programming4us
           
 
 
Applications Server

Microsoft Dynamics AX 2009 : The Application Integration Framework (part 7) - Sending One-Way Requests from Dynamics AX

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
6/28/2013 7:40:24 PM

Sending One-Way Requests from Dynamics AX

In many scenarios, receiving a response or an error message from the consuming application isn’t required. An acknowledgment that the message has successfully been delivered to the next hop in a chain of reliable transport links (e.g., MSMQ) can be sufficient. Messages that are transmitted without a synchronous end-to-end feedback channel for response or error messages are referred to as one-way messages.

When you think about exchanging business documents electronically with your trading partners, you need to accept that it might not be realistic to assume that your trading partners’ applications will always be online and ready to receive your messages. With some partners, building more robust, loosely coupled integrations using one-way messages might be a better solution.

AIF provides APIs to send unsolicited one-way messages by using Dynamics AX services and the AIF infrastructure (e.g., channels and endpoints). The Dynamics AX client features Send Electronically buttons on several forms that allow you to transmit business documents (such as invoices) as unsolicited one-way messages through AIF channels to AIF endpoints. Dynamics AX is aware of only the AIF channel it needs to send the message to (i.e., the next hop); it doesn’t know the final destination of the message. Moreover, Dynamics AX doesn’t rely on any external document schema definitions to be provided by the remote receiving application; it uses its own format instead—the same Axd<Document> class-based XSDs that are also used as data contracts for published Dynamics AX services.

Implementing unsolicited messages exchanges requires the following two steps:

  • Implementing a trigger for transmission (design time)

  • Configuring transmission mechanisms (admin time)

Implementing a Trigger for Transmission

You can implement a trigger for transmission by using either the AIF Send API or the AxdSend API.

AIF Send API

The Send API in AIF features a set of methods that can be used to send unsolicited one-way messages from Dynamics AX to AIF channels, through which the consumers can pick up the messages. This API sends a single message; the body of the message is the XML that is generated by invoking the service operation read of the AIF document service referenced by serviceClassId (it must reference a class that derives from AifDocumentService) with the parameter entityKey.

To see a working example of how you can use this API, look at the code behind the method clicked for the button SendXmlOriginal on the form CustInvoiceJournal. The API methods are defined on the class AifSendService and include the method submitDefault.

public static void submitDefault(
    AifServiceClassId serviceClassId,
    AifEntityKey entityKey,
    AifConstraintList constraintList,
    AifSendMode sendMode,
    AifPropertyBag propertyBag = connull(),
    AifProcessingMode processingMode = AifProcessingMode::Sequential,
    AifConversationId conversationId = #NoConversationId
)


The two optional parameters in the preceding signature, processingMode and conversationId, are new in Dynamics AX 2009. They allow you to leverage the newly introduced parallel message processing feature for asynchronous adapters:

  • processingMode Specifies whether messages can be moved from the AIF outbound processing queue to the AIF gateway queue in parallel (AifProcessingMode:: Parallel) or whether first in first out (FIFO) order must be enforced for all messages (AifProcessingMode::Sequential).

  • conversationId If specified, moves from the AIF outbound processing queue to the AIF gateway queue in FIFO order, relative to all other messages with the same conversationId. The order relative to all other messages with other conversationIds isn’t guaranteed.

AxdSend API

The AxdSend API provides functionality to send unsolicited one-way messages for which the user needs to select AIF endpoints dynamically at run time or in which the message body contains more than a single entity. The user dynamically selects the exact range of entities, such as a range of ledger accounts, at run time. This feature has been implemented for several Dynamics AX document services, including AxdChartOfAccounts and AxdPricelist.

The AxdSend framework provides default dialog boxes for selecting endpoints and entity ranges and allows the generation of XML documents with multiple records. The framework allows you to provide specific dialog boxes for documents that need more user input than the default dialog box provides.

The default dialog box includes an endpoint drop-down list and, optionally, a Select button to open the standard query form. The query is retrieved from the Axd<Document> class the caller specifies. Many endpoints can be configured in the AIF, but only a few are allowed to receive the current document. The lookup shows only the endpoints that are valid for the document, complying with the constraint set up for the service operation read for the current document.

The framework requires minimal coding to support a new document. If a document requires you to simply select an endpoint and fill out a query range, most of the functionality is provided by the framework, without requiring additional code.

The standard dialog box for the AxdSend framework is shown in Figure 6.

Figure 6. Send Document Electronically dialog box for Chart of accounts

If a document requires a more specific dialog box, you simply inherit the AxdSend class and provide the necessary user interface interaction to the dialog box method. In the following code example, an extra field has been added to the dialog box. You simply add one line of code (shown in bold in the following code from the AxdSendChartOfAccounts class) to implement parmShowDocPurpose from the AxdSend class and to make this field appear on the dialog box.

static public void main(Args args)
{
   AxdSendChartofAccounts axdSendChartofAccounts ;
   AifConstraintList aifConstraintList;
   AifConstraint aifConstraint;
   ;
   axdSendChartofAccounts = new AxdSendChartofAccounts();
   aifConstraintList = new AifConstraintList();
   aifConstraint = new AifConstraint();

   aifConstraint.parmType(AifConstraintType::NoConstraint);
   aifConstraintList.addConstraint(aifConstraint);
axdSendChartofAccounts.parmShowDocPurpose(true) ;

    axdSendChartofAccounts.sendMultipleDocuments(classnum(AxdChartOfAccounts),A
ifSendMode::Async,aifConstraintList) ;

}

					  


Sorting isn’t supported in the AxdSend framework, and the query structure is locked to ensure that the resulting query matches the query defined by the XML document framework. This need for matching is why the AxdSend class enforces these sorting and structure limitations. The query dialog box shows only the fields on the top-level tables because of the mechanics of queries with an outer join predicate. The result set will likely be different from what would be expected from a user perspective. For example, restrictions on inner data sources filter only these data sources, not the data sources that contain them. The restrictions are imposed on the user interface to match the restrictions on the query when using the document service’s operation find.

Other -----------------
- Microsoft Systems Management Server 2003 : Rolling Back and Uninstalling a Scripted Installation
- Microsoft Systems Management Server 2003 : Modifying Installation Scripts Using Script Editor (part 2) - Modifying the Script, Windows Installer Step-Up Utility Buttons
- Microsoft Systems Management Server 2003 : Modifying Installation Scripts Using Script Editor (part 1) - Script Editor Variables and Actions
- System Center Configuration Manager 2007 : Architecture Design Planning - Site Planning
- System Center Configuration Manager 2007 : Hierarchy Planning
- Microsoft Systems Management Server 2003 : Modifying Installation Scripts Using the Installation Expert (part 2)
- Microsoft Systems Management Server 2003 : Modifying Installation Scripts Using the Installation Expert (part 1)
- Sizing Considerations for mySAP Components (part 2) - Sizing mySAP Business Intelligence & Sizing mySAP SRM
- Sizing Considerations for mySAP Components (part 1) - The SAP Exchange Infrastructure
- Active Directory Domain Services 2008 : Transfer the Infrastructure Master Role
- Active Directory Domain Services 2008 : Transfer the PDC Emulator Role
- SAP Hardware, OS, and Database Sizing
- Preparing for the SAP Sizing Process
- Microsoft Systems Management Server 2003 : Systems Management Server Installer Tools & Creating Installation Scripts
- Installing Systems Management Server Installer
- Microsoft Dynamic GP 2010 : Installing Integration Manager (part 2) - SQL Server maintenance jobs
- Microsoft Dynamic GP 2010 : Installing Integration Manager (part 1) - SQL Server and database settings
- Active Directory Domain Services 2008 : Transfer the RID Master Role
- Active Directory Domain Services 2008 : Transfer the Domain Naming Master Role
- Microsoft Dynamics AX 2009 : Working with Forms - Modifying application version
 
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
programming4us programming4us